import { LazyLoad } from '@/library/widgets'
import type { IRoutesItem } from '@/router/baseType'
import { demoHooksPaths } from './paths'

const DemoHooksIndex = LazyLoad('demo-hooks')
const DemoHooksHome = LazyLoad('demo-hooks/home')
const DemoHooksUseThrottle = LazyLoad('demo-hooks/useThrottle')

export const DemoHooksRoutes: IRoutesItem = {
  path: demoHooksPaths.basePagePath,
  component: DemoHooksIndex,
  openDefaultIndex: true,
  children: [
    {
      path: demoHooksPaths.home,
      component: DemoHooksHome,
    },
    {
      path: demoHooksPaths.useThrottle,
      component: DemoHooksUseThrottle,
    },
  ],
}
